{% extends 'base.html' %}

{% load comments %}
{% load forum_tags %}

{% block main %}
    <main class="col-md-8 mb-1">
        <div class="card card-block">
            <div class="media">
                <div class="media-left">
                    <img class="media-object" src="{{ user.mugshot_thumbnail.url }}" alt=""
                         style="width: 73px;">
                </div>
                <div class="media-body">
                    <h3 class="media-heading">{{ user.nickname }}</h3>
                    <p>{{ user.signature }}</p>
                    <div>django forum demo 第 {{ user.pk }} 号会员，加入于 {{ user.date_joined }}</div>
                </div>
            </div>
        </div>
        <ul class="list-group mb-1">
            <li class="list-group-item">
                {{ user.nickname }} 发布的所有帖子
            </li>
            {% for post in post_list %}
                <li class="list-group-item">
                    {% include 'users/_user_post_item.html' %}
                </li>
            {% empty %}
                <li class="list-group-item">该用户下没有帖子</li>
            {% endfor %}
            {% if not post_list.count < 10 %}
                <li class="list-group-item small"><a href="{% url 'users:posts' user.username %}"
                                                     class="text-muted">{{ user.nickname }}
                    发布的更多帖子>></a></li>
            {% endif %}
        </ul>
        <ul class="list-group">
            <li class="list-group-item">
                {{ user.nickname }} 最近回复了
            </li>
            {% for reply in reply_list %}
                {% include 'users/_user_reply_item.html' %}
            {% empty %}
                <li class="list-group-item">该用户下没有回复</li>
            {% endfor %}
            {% if not reply_list.count < 10 %}
                <li class="list-group-item small"><a href="{% url 'users:replies' user.username %}"
                                                     class="text-muted">{{ user.nickname }}
                    创建的更多回复>></a></li>
            {% endif %}
        </ul>
    </main>
{% endblock main %}